/**
 * Class representing a link between two nodes creating a graph structure for the neural network 
 *
 */
public class NeuralLink {
	
	private AbstractNeuron sender;
	private AbstractNeuron receiver;
	private double weight;
	
	public NeuralLink(AbstractNeuron sender, AbstractNeuron receiver) {
		this.receiver = receiver;
		this.sender = sender;
		// Start with a random weight to fasten convergence
		this.weight = Math.random() - 0.5;
		this.receiver.addToInputList(this);
		this.sender.addToOutputLink(this);
	}
	
	public double getWeight() {
		return weight;
	}
	public void setWeight(double weight) {
		this.weight = weight;
	}
	public AbstractNeuron getSender() {
		return sender;
	}
	public AbstractNeuron getReceiver() {
		return receiver;
	}
	
}
